<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:aw="clr-namespace:Assergs.Windows"
	>

    <Style x:Key="RadioButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle
                          Margin="15,0,0,0"
                          StrokeThickness="1"
                          Stroke="#60000000"
                          StrokeDashArray="1 2"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <SolidColorBrush x:Key="NormalBorderBrush" Color="{x:Static aw:RadioButtonPallet.NormalBorder}"/>
    <SolidColorBrush x:Key="GlyphBrush" Color="{x:Static aw:RadioButtonPallet.Glyph}"/>
    
    <SolidColorBrush x:Key="DisabledBorderhBrush" Color="{x:Static aw:RadioButtonPallet.DisabledBorder}"/>
    <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="{x:Static aw:RadioButtonPallet.DisabledBackground}"/>
    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="{x:Static aw:RadioButtonPallet.DisabledForeground}"/>

    <RadialGradientBrush x:Key="NormalBackgroundBrush" RadiusX="0.5" RadiusY="0.5">
        <GradientStop Color="{x:Static aw:RadioButtonPallet.NormalBackground1}"/>
        <GradientStop Color="{x:Static aw:RadioButtonPallet.NormalBackground2}"/>
    </RadialGradientBrush>
    
    <RadialGradientBrush x:Key="LightBackgroundBrush" GradientOrigin="0.5,0.5" Center="0.5,0.5" RadiusX="0.5" RadiusY="0.5">
        <GradientStop Color="{x:Static aw:RadioButtonPallet.LightBackground2}" Offset="0.3"/>
        <GradientStop Color="{x:Static aw:RadioButtonPallet.LightBackground1}" Offset="1"/>
    </RadialGradientBrush>
    
    <RadialGradientBrush x:Key="PlusLightBackgroundBrush" GradientOrigin="0.5,0.5" Center="0.5,0.5" RadiusX="0.5" RadiusY="0.5">
        <GradientStop Color="{x:Static aw:RadioButtonPallet.PlusLightBackground2}" Offset="0.3"/>
        <GradientStop Color="{x:Static aw:RadioButtonPallet.PlusLightBackground1}" Offset="1"/>
    </RadialGradientBrush>

    <Style x:Key="{x:Type RadioButton}" TargetType="{x:Type RadioButton}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource RadioButtonFocusVisual}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <BulletDecorator Background="Transparent">
                        <BulletDecorator.Bullet>
                            <Grid Width="13" Height="13" >
                                <Ellipse x:Name="Border"
                                  Fill="{StaticResource NormalBackgroundBrush}"
                                  StrokeThickness="1"
                                  Stroke="{StaticResource NormalBorderBrush}" />
                                <Ellipse x:Name="CheckMark"
                                  Margin="4"
                                  Fill="{StaticResource GlyphBrush}" />
                            </Grid>
                        </BulletDecorator.Bullet>
                        <ContentPresenter
                          Margin="4,0,0,0"
                          VerticalAlignment="Center"
                          HorizontalAlignment="Left"
                          RecognizesAccessKey="True"/>
                    </BulletDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource LightBackgroundBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource PlusLightBackgroundBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource DisabledBackgroundBrush}"/>
                            <Setter TargetName="Border" Property="Stroke" Value="{StaticResource DisabledBorderhBrush}"/>
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>